/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package glamourbeautyclinic.service;


import java.awt.Dimension;
import java.awt.Toolkit;
import images.GlamourImage;
import java.awt.Point;
import java.util.Vector;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JDesktopPane;
import javax.swing.JInternalFrame;
import javax.swing.JOptionPane;
import javax.swing.JTable;
import javax.swing.RowSorter;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableModel;
import javax.swing.table.TableRowSorter;
import util.DBConnection;




/**
 *
 * @author anh
 */
public class FrmCate_Service extends javax.swing.JInternalFrame {
    //Declare for EVERY form
    GlamourImage GI = new GlamourImage();
    //DBConnection dc = new DBConnection();
    DBConnection dc;
    //Declare for CONCRETE form
    
    
    /**
     * Creates new form frmSearchCustomer
     */
    public FrmCate_Service(DBConnection dc) {
        //this.setContentPane(new ImageBackgroundPanel(new ImageIcon(GI.getClass().getResource("Frame.png"))));
        initComponents();
        this.dc = dc;
        GI.addIconFor(this);
        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
        // Can be resize height parameter to proper scale
        this.setLocation((screenSize.width - this.getWidth()) / 2-200, 10);
        RowSorter<TableModel> sorter = new TableRowSorter<TableModel>(tblSer.getModel());
        tblSer.setRowSorter(sorter);
        tblSer.setComponentPopupMenu(pmnSer);
        tblSer.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
            public void valueChanged(ListSelectionEvent evt) {
                tblSerValueChanged(evt);
            }
        });
        
        
    }


    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        pmnSer = new javax.swing.JPopupMenu();
        mniAddSer = new javax.swing.JMenuItem();
        mniUpdateSer = new javax.swing.JMenuItem();
        jSeparator1 = new javax.swing.JPopupMenu.Separator();
        mniSelectAll = new javax.swing.JMenuItem();
        mniDeselect = new javax.swing.JMenuItem();
        mniLockSer = new javax.swing.JMenuItem();
        mniUnlockSer = new javax.swing.JMenuItem();
        jSeparator2 = new javax.swing.JPopupMenu.Separator();
        mniViewApp = new javax.swing.JMenuItem();
        pnlManagement = new javax.swing.JPanel();
        pnlCategory = new javax.swing.JPanel();
        btnAddCat = new javax.swing.JButton();
        btnUpdateCat = new javax.swing.JButton();
        btnLockCat = new javax.swing.JButton();
        btnUnlockCat = new javax.swing.JButton();
        jspCate = new javax.swing.JScrollPane();
        lstCat = new javax.swing.JList();
        pnlService = new javax.swing.JPanel();
        btnSelectAll = new javax.swing.JButton();
        btnDeselect = new javax.swing.JButton();
        btnAddSer = new javax.swing.JButton();
        btnUpdateSer = new javax.swing.JButton();
        btnLockSer = new javax.swing.JButton();
        btnUnlockSer = new javax.swing.JButton();
        btnPopup = new javax.swing.JButton();
        jspSer = new javax.swing.JScrollPane();
        tblSer = new javax.swing.JTable();
        pnlDetailsCat = new javax.swing.JPanel();
        lblCatName = new javax.swing.JLabel();
        lblRequired1 = new javax.swing.JLabel();
        txtCatName = new javax.swing.JTextField();
        lblFac = new javax.swing.JLabel();
        lblRequired2 = new javax.swing.JLabel();
        txtFac = new javax.swing.JTextField();
        lblDesCat = new javax.swing.JLabel();
        jspDesCat = new javax.swing.JScrollPane();
        txaDesCat = new javax.swing.JTextArea();
        lblCatMsg = new javax.swing.JLabel();
        lblCatID = new javax.swing.JLabel();
        lblRequired7 = new javax.swing.JLabel();
        txtCatID = new javax.swing.JTextField();
        pnlDetailsSer = new javax.swing.JPanel();
        lblSerName = new javax.swing.JLabel();
        lblRequired3 = new javax.swing.JLabel();
        txtSerName = new javax.swing.JTextField();
        lblCat = new javax.swing.JLabel();
        lblRequired4 = new javax.swing.JLabel();
        cboCat = new javax.swing.JComboBox();
        lblPrice = new javax.swing.JLabel();
        lblRequired5 = new javax.swing.JLabel();
        txtPrice = new javax.swing.JTextField();
        lblDesSer = new javax.swing.JLabel();
        jspDesSer = new javax.swing.JScrollPane();
        txaDesSer = new javax.swing.JTextArea();
        lblSerMsg = new javax.swing.JLabel();
        lblSerID = new javax.swing.JLabel();
        lblRequired6 = new javax.swing.JLabel();
        txtSerID = new javax.swing.JTextField();
        pnlButton = new javax.swing.JPanel();
        jButton1 = new javax.swing.JButton();
        btnSave = new javax.swing.JButton();
        btnExit = new javax.swing.JButton();

        pmnSer.setEnabled(false);

        mniAddSer.setText("New");
        pmnSer.add(mniAddSer);

        mniUpdateSer.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/Update.png"))); // NOI18N
        mniUpdateSer.setText("Update");
        pmnSer.add(mniUpdateSer);
        pmnSer.add(jSeparator1);

        mniSelectAll.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/SelectAll.png"))); // NOI18N
        mniSelectAll.setText("Select all");
        pmnSer.add(mniSelectAll);

        mniDeselect.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/Deselect.png"))); // NOI18N
        mniDeselect.setText("Deselect");
        pmnSer.add(mniDeselect);

        mniLockSer.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/Lock.png"))); // NOI18N
        mniLockSer.setText("Lock");
        pmnSer.add(mniLockSer);

        mniUnlockSer.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/Lock.png"))); // NOI18N
        mniUnlockSer.setText("Unlock");
        pmnSer.add(mniUnlockSer);
        pmnSer.add(jSeparator2);

        mniViewApp.setText("View appointment");
        mniViewApp.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mniViewAppActionPerformed(evt);
            }
        });
        pmnSer.add(mniViewApp);

        setClosable(true);
        setIconifiable(true);
        setTitle("Category and Service Management");
        addInternalFrameListener(new javax.swing.event.InternalFrameListener() {
            public void internalFrameActivated(javax.swing.event.InternalFrameEvent evt) {
            }
            public void internalFrameClosed(javax.swing.event.InternalFrameEvent evt) {
            }
            public void internalFrameClosing(javax.swing.event.InternalFrameEvent evt) {
                formInternalFrameClosing(evt);
            }
            public void internalFrameDeactivated(javax.swing.event.InternalFrameEvent evt) {
            }
            public void internalFrameDeiconified(javax.swing.event.InternalFrameEvent evt) {
                formInternalFrameDeiconified(evt);
            }
            public void internalFrameIconified(javax.swing.event.InternalFrameEvent evt) {
                formInternalFrameIconified(evt);
            }
            public void internalFrameOpened(javax.swing.event.InternalFrameEvent evt) {
            }
        });
        addComponentListener(new java.awt.event.ComponentAdapter() {
            public void componentMoved(java.awt.event.ComponentEvent evt) {
                formComponentMoved(evt);
            }
        });

        pnlManagement.setBorder(javax.swing.BorderFactory.createTitledBorder(new javax.swing.border.LineBorder(new java.awt.Color(0, 0, 0), 1, true), "Category and Service", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Arial", 1, 12), new java.awt.Color(51, 51, 51))); // NOI18N
        pnlManagement.setOpaque(false);

        pnlCategory.setBorder(javax.swing.BorderFactory.createTitledBorder(new javax.swing.border.LineBorder(new java.awt.Color(113, 147, 183), 1, true), "Category", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Arial", 1, 12), new java.awt.Color(0, 51, 255))); // NOI18N
        pnlCategory.setOpaque(false);

        btnAddCat.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/Insert.png"))); // NOI18N
        btnAddCat.setToolTipText("Insert new service");
        btnAddCat.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
        btnAddCat.setBorderPainted(false);
        btnAddCat.setContentAreaFilled(false);

        btnUpdateCat.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/Update.png"))); // NOI18N
        btnUpdateCat.setToolTipText("Update service information");
        btnUpdateCat.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
        btnUpdateCat.setBorderPainted(false);
        btnUpdateCat.setContentAreaFilled(false);

        btnLockCat.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/Lock.png"))); // NOI18N
        btnLockCat.setToolTipText("Lock service");
        btnLockCat.setBorderPainted(false);
        btnLockCat.setContentAreaFilled(false);
        btnLockCat.setEnabled(false);

        btnUnlockCat.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/Unlock.png"))); // NOI18N
        btnUnlockCat.setToolTipText("Unlock service");
        btnUnlockCat.setBorderPainted(false);
        btnUnlockCat.setContentAreaFilled(false);
        btnUnlockCat.setEnabled(false);

        lstCat.setForeground(new java.awt.Color(0, 102, 51));
        lstCat.setModel(new javax.swing.AbstractListModel() {
            String[] strings = { "Hair", "Skin", "Nail", "Massage" };
            public int getSize() { return strings.length; }
            public Object getElementAt(int i) { return strings[i]; }
        });
        lstCat.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
        jspCate.setViewportView(lstCat);

        javax.swing.GroupLayout pnlCategoryLayout = new javax.swing.GroupLayout(pnlCategory);
        pnlCategory.setLayout(pnlCategoryLayout);
        pnlCategoryLayout.setHorizontalGroup(
            pnlCategoryLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlCategoryLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(pnlCategoryLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(pnlCategoryLayout.createSequentialGroup()
                        .addComponent(btnAddCat, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(btnUpdateCat, javax.swing.GroupLayout.PREFERRED_SIZE, 22, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(btnLockCat, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(btnUnlockCat, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(0, 1, Short.MAX_VALUE))
                    .addComponent(jspCate, javax.swing.GroupLayout.DEFAULT_SIZE, 102, Short.MAX_VALUE))
                .addContainerGap())
        );
        pnlCategoryLayout.setVerticalGroup(
            pnlCategoryLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pnlCategoryLayout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(pnlCategoryLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(btnAddCat, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(btnUpdateCat, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(btnLockCat, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(btnUnlockCat))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jspCate, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(12, 12, 12))
        );

        pnlService.setBorder(javax.swing.BorderFactory.createTitledBorder(new javax.swing.border.LineBorder(new java.awt.Color(113, 147, 183), 1, true), "Service", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Arial", 1, 12), new java.awt.Color(0, 51, 255))); // NOI18N
        pnlService.setOpaque(false);

        btnSelectAll.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        btnSelectAll.setForeground(new java.awt.Color(0, 51, 51));
        btnSelectAll.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/SelectAll.png"))); // NOI18N
        btnSelectAll.setMnemonic('a');
        btnSelectAll.setText("Select all");
        btnSelectAll.setToolTipText("Check all select combo box");
        btnSelectAll.setBorder(null);
        btnSelectAll.setContentAreaFilled(false);
        btnSelectAll.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        btnSelectAll.setMargin(new java.awt.Insets(6, 6, 6, 6));
        btnSelectAll.setName(""); // NOI18N
        btnSelectAll.setOpaque(true);
        btnSelectAll.setPreferredSize(new java.awt.Dimension(59, 22));
        btnSelectAll.setRolloverEnabled(false);

        btnDeselect.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        btnDeselect.setForeground(new java.awt.Color(0, 51, 51));
        btnDeselect.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/Deselect.png"))); // NOI18N
        btnDeselect.setMnemonic('e');
        btnDeselect.setText("Deselect");
        btnDeselect.setToolTipText("Uncheck all select combo box");
        btnDeselect.setBorder(null);
        btnDeselect.setContentAreaFilled(false);
        btnDeselect.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        btnDeselect.setMargin(new java.awt.Insets(6, 6, 6, 6));
        btnDeselect.setName(""); // NOI18N
        btnDeselect.setOpaque(true);
        btnDeselect.setPreferredSize(new java.awt.Dimension(59, 22));
        btnDeselect.setRolloverEnabled(false);

        btnAddSer.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/Insert.png"))); // NOI18N
        btnAddSer.setToolTipText("Insert new service");
        btnAddSer.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
        btnAddSer.setBorderPainted(false);
        btnAddSer.setContentAreaFilled(false);

        btnUpdateSer.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/Update.png"))); // NOI18N
        btnUpdateSer.setToolTipText("Update service information");
        btnUpdateSer.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
        btnUpdateSer.setBorderPainted(false);
        btnUpdateSer.setContentAreaFilled(false);

        btnLockSer.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/Lock.png"))); // NOI18N
        btnLockSer.setToolTipText("Lock service");
        btnLockSer.setBorderPainted(false);
        btnLockSer.setContentAreaFilled(false);
        btnLockSer.setEnabled(false);

        btnUnlockSer.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/Unlock.png"))); // NOI18N
        btnUnlockSer.setToolTipText("Unlock service");
        btnUnlockSer.setBorderPainted(false);
        btnUnlockSer.setContentAreaFilled(false);
        btnUnlockSer.setEnabled(false);

        btnPopup.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/001_25.png"))); // NOI18N
        btnPopup.setToolTipText("Insert new service");
        btnPopup.setBorderPainted(false);
        btnPopup.setContentAreaFilled(false);
        btnPopup.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnPopupActionPerformed(evt);
            }
        });

        tblSer.setForeground(new java.awt.Color(0, 102, 51));
        tblSer.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, "Hair wash", "45", "Clean your hair with water and shampoo"},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Select", "Service Name", "Price", "Description"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.Boolean.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class
            };
            boolean[] canEdit = new boolean [] {
                true, false, false, false
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        tblSer.setOpaque(false);
        tblSer.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
        tblSer.getTableHeader().setReorderingAllowed(false);
        tblSer.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mousePressed(java.awt.event.MouseEvent evt) {
                tblSerMousePressed(evt);
            }
        });
        jspSer.setViewportView(tblSer);
        if (tblSer.getColumnModel().getColumnCount() > 0) {
            tblSer.getColumnModel().getColumn(0).setPreferredWidth(50);
            tblSer.getColumnModel().getColumn(1).setPreferredWidth(140);
            tblSer.getColumnModel().getColumn(2).setPreferredWidth(50);
            tblSer.getColumnModel().getColumn(3).setPreferredWidth(260);
        }

        javax.swing.GroupLayout pnlServiceLayout = new javax.swing.GroupLayout(pnlService);
        pnlService.setLayout(pnlServiceLayout);
        pnlServiceLayout.setHorizontalGroup(
            pnlServiceLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlServiceLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(pnlServiceLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(pnlServiceLayout.createSequentialGroup()
                        .addComponent(jspSer)
                        .addContainerGap())
                    .addGroup(pnlServiceLayout.createSequentialGroup()
                        .addComponent(btnSelectAll, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(btnDeselect, javax.swing.GroupLayout.PREFERRED_SIZE, 69, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(btnAddSer, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(btnUpdateSer, javax.swing.GroupLayout.PREFERRED_SIZE, 22, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(btnLockSer, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(btnUnlockSer, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(btnPopup, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(16, 16, 16))))
        );
        pnlServiceLayout.setVerticalGroup(
            pnlServiceLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlServiceLayout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(pnlServiceLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(pnlServiceLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(btnSelectAll, javax.swing.GroupLayout.PREFERRED_SIZE, 22, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(btnDeselect, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(btnAddSer, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(btnUpdateSer, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(btnLockSer, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(btnUnlockSer, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(btnPopup, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jspSer, javax.swing.GroupLayout.PREFERRED_SIZE, 127, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(43, 43, 43))
        );

        javax.swing.GroupLayout pnlManagementLayout = new javax.swing.GroupLayout(pnlManagement);
        pnlManagement.setLayout(pnlManagementLayout);
        pnlManagementLayout.setHorizontalGroup(
            pnlManagementLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlManagementLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(pnlCategory, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(pnlService, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGap(10, 10, 10))
        );
        pnlManagementLayout.setVerticalGroup(
            pnlManagementLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlManagementLayout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(pnlManagementLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(pnlCategory, javax.swing.GroupLayout.PREFERRED_SIZE, 198, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(pnlService, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)))
        );

        pnlDetailsCat.setBorder(javax.swing.BorderFactory.createTitledBorder(new javax.swing.border.LineBorder(new java.awt.Color(0, 0, 0), 1, true), "Category details infomation", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Arial", 1, 12), new java.awt.Color(51, 51, 51))); // NOI18N
        pnlDetailsCat.setOpaque(false);

        lblCatName.setDisplayedMnemonic('n');
        lblCatName.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        lblCatName.setForeground(new java.awt.Color(0, 51, 255));
        lblCatName.setText("Categoty Name");
        lblCatName.setPreferredSize(new java.awt.Dimension(38, 20));

        lblRequired1.setForeground(new java.awt.Color(255, 51, 51));
        lblRequired1.setText("(*)");
        lblRequired1.setPreferredSize(new java.awt.Dimension(38, 20));

        txtCatName.setForeground(new java.awt.Color(0, 102, 51));
        txtCatName.setEnabled(false);
        txtCatName.setPreferredSize(new java.awt.Dimension(56, 20));

        lblFac.setDisplayedMnemonic('r');
        lblFac.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        lblFac.setForeground(new java.awt.Color(0, 51, 255));
        lblFac.setText("No of Facilities");
        lblFac.setPreferredSize(new java.awt.Dimension(38, 20));

        lblRequired2.setForeground(new java.awt.Color(255, 51, 51));
        lblRequired2.setText("(*)");
        lblRequired2.setPreferredSize(new java.awt.Dimension(38, 20));

        txtFac.setForeground(new java.awt.Color(0, 102, 51));
        txtFac.setEnabled(false);
        txtFac.setPreferredSize(new java.awt.Dimension(56, 20));

        lblDesCat.setDisplayedMnemonic('r');
        lblDesCat.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        lblDesCat.setForeground(new java.awt.Color(0, 51, 255));
        lblDesCat.setText("Description");
        lblDesCat.setPreferredSize(new java.awt.Dimension(38, 20));

        txaDesCat.setColumns(20);
        txaDesCat.setForeground(new java.awt.Color(0, 102, 51));
        txaDesCat.setRows(5);
        txaDesCat.setEnabled(false);
        jspDesCat.setViewportView(txaDesCat);

        lblCatMsg.setForeground(new java.awt.Color(255, 51, 51));
        lblCatMsg.setText("Requied numeric");
        lblCatMsg.setPreferredSize(new java.awt.Dimension(38, 20));

        lblCatID.setDisplayedMnemonic('n');
        lblCatID.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        lblCatID.setForeground(new java.awt.Color(0, 51, 255));
        lblCatID.setText("Categoty ID");
        lblCatID.setPreferredSize(new java.awt.Dimension(38, 20));

        lblRequired7.setForeground(new java.awt.Color(255, 51, 51));
        lblRequired7.setText("(*)");
        lblRequired7.setPreferredSize(new java.awt.Dimension(38, 20));

        txtCatID.setForeground(new java.awt.Color(0, 102, 51));
        txtCatID.setEnabled(false);
        txtCatID.setPreferredSize(new java.awt.Dimension(56, 20));

        javax.swing.GroupLayout pnlDetailsCatLayout = new javax.swing.GroupLayout(pnlDetailsCat);
        pnlDetailsCat.setLayout(pnlDetailsCatLayout);
        pnlDetailsCatLayout.setHorizontalGroup(
            pnlDetailsCatLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlDetailsCatLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(pnlDetailsCatLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(pnlDetailsCatLayout.createSequentialGroup()
                        .addGroup(pnlDetailsCatLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                            .addComponent(lblFac, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(lblDesCat, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(lblCatName, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 87, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(pnlDetailsCatLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(lblRequired1, javax.swing.GroupLayout.PREFERRED_SIZE, 17, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(lblRequired2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 17, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(pnlDetailsCatLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(txtFac, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(lblCatMsg, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(txtCatName, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jspDesCat, javax.swing.GroupLayout.DEFAULT_SIZE, 183, Short.MAX_VALUE)))
                    .addGroup(pnlDetailsCatLayout.createSequentialGroup()
                        .addComponent(lblCatID, javax.swing.GroupLayout.PREFERRED_SIZE, 87, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(lblRequired7, javax.swing.GroupLayout.PREFERRED_SIZE, 17, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(txtCatID, javax.swing.GroupLayout.PREFERRED_SIZE, 96, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        pnlDetailsCatLayout.setVerticalGroup(
            pnlDetailsCatLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pnlDetailsCatLayout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(pnlDetailsCatLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(lblCatID, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(lblRequired7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtCatID, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(pnlDetailsCatLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(lblCatName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(lblRequired1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtCatName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(pnlDetailsCatLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(lblFac, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(pnlDetailsCatLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(lblRequired2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(txtFac, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(pnlDetailsCatLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(lblDesCat, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jspDesCat, javax.swing.GroupLayout.PREFERRED_SIZE, 127, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(lblCatMsg, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(30, 30, 30))
        );

        pnlDetailsSer.setBorder(javax.swing.BorderFactory.createTitledBorder(new javax.swing.border.LineBorder(new java.awt.Color(0, 0, 0), 1, true), "Service details infomation", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Arial", 1, 12), new java.awt.Color(51, 51, 51))); // NOI18N
        pnlDetailsSer.setOpaque(false);

        lblSerName.setDisplayedMnemonic('n');
        lblSerName.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        lblSerName.setForeground(new java.awt.Color(0, 51, 255));
        lblSerName.setText("Service Name");
        lblSerName.setPreferredSize(new java.awt.Dimension(38, 20));

        lblRequired3.setForeground(new java.awt.Color(255, 51, 51));
        lblRequired3.setText("(*)");
        lblRequired3.setPreferredSize(new java.awt.Dimension(38, 20));

        txtSerName.setForeground(new java.awt.Color(0, 102, 51));
        txtSerName.setEnabled(false);
        txtSerName.setPreferredSize(new java.awt.Dimension(56, 20));

        lblCat.setDisplayedMnemonic('r');
        lblCat.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        lblCat.setForeground(new java.awt.Color(0, 51, 255));
        lblCat.setText("Category");
        lblCat.setPreferredSize(new java.awt.Dimension(38, 20));

        lblRequired4.setForeground(new java.awt.Color(255, 51, 51));
        lblRequired4.setText("(*)");
        lblRequired4.setPreferredSize(new java.awt.Dimension(38, 20));

        cboCat.setForeground(new java.awt.Color(0, 102, 51));
        cboCat.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Hair", "Item 2", "Item 3", "Item 4" }));
        cboCat.setEnabled(false);

        lblPrice.setDisplayedMnemonic('r');
        lblPrice.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        lblPrice.setForeground(new java.awt.Color(0, 51, 255));
        lblPrice.setText("Price");
        lblPrice.setPreferredSize(new java.awt.Dimension(38, 20));

        lblRequired5.setForeground(new java.awt.Color(255, 51, 51));
        lblRequired5.setText("(*)");
        lblRequired5.setPreferredSize(new java.awt.Dimension(38, 20));

        txtPrice.setForeground(new java.awt.Color(0, 102, 51));
        txtPrice.setEnabled(false);
        txtPrice.setPreferredSize(new java.awt.Dimension(56, 20));

        lblDesSer.setDisplayedMnemonic('r');
        lblDesSer.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        lblDesSer.setForeground(new java.awt.Color(0, 51, 255));
        lblDesSer.setText("Description");
        lblDesSer.setPreferredSize(new java.awt.Dimension(38, 20));

        txaDesSer.setColumns(20);
        txaDesSer.setForeground(new java.awt.Color(0, 102, 51));
        txaDesSer.setRows(5);
        txaDesSer.setEnabled(false);
        jspDesSer.setViewportView(txaDesSer);

        lblSerMsg.setForeground(new java.awt.Color(255, 51, 51));
        lblSerMsg.setText("Price can not be blank.");
        lblSerMsg.setPreferredSize(new java.awt.Dimension(38, 20));

        lblSerID.setDisplayedMnemonic('n');
        lblSerID.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        lblSerID.setForeground(new java.awt.Color(0, 51, 255));
        lblSerID.setText("Service ID");
        lblSerID.setPreferredSize(new java.awt.Dimension(38, 20));

        lblRequired6.setForeground(new java.awt.Color(255, 51, 51));
        lblRequired6.setText("(*)");
        lblRequired6.setPreferredSize(new java.awt.Dimension(38, 20));

        txtSerID.setForeground(new java.awt.Color(0, 102, 51));
        txtSerID.setEnabled(false);
        txtSerID.setPreferredSize(new java.awt.Dimension(56, 20));

        javax.swing.GroupLayout pnlDetailsSerLayout = new javax.swing.GroupLayout(pnlDetailsSer);
        pnlDetailsSer.setLayout(pnlDetailsSerLayout);
        pnlDetailsSerLayout.setHorizontalGroup(
            pnlDetailsSerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlDetailsSerLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(pnlDetailsSerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(pnlDetailsSerLayout.createSequentialGroup()
                        .addGroup(pnlDetailsSerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(lblDesSer, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(lblCat, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(lblPrice, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(lblSerName, javax.swing.GroupLayout.PREFERRED_SIZE, 85, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(pnlDetailsSerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addGroup(pnlDetailsSerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addComponent(lblRequired5, javax.swing.GroupLayout.PREFERRED_SIZE, 17, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(lblRequired3, javax.swing.GroupLayout.PREFERRED_SIZE, 17, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addComponent(lblRequired4, javax.swing.GroupLayout.PREFERRED_SIZE, 17, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(pnlDetailsSerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(lblSerMsg, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(txtSerName, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(cboCat, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(txtPrice, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jspDesSer, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(pnlDetailsSerLayout.createSequentialGroup()
                        .addComponent(lblSerID, javax.swing.GroupLayout.PREFERRED_SIZE, 85, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(lblRequired6, javax.swing.GroupLayout.PREFERRED_SIZE, 17, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(txtSerID, javax.swing.GroupLayout.PREFERRED_SIZE, 85, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        pnlDetailsSerLayout.setVerticalGroup(
            pnlDetailsSerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pnlDetailsSerLayout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(pnlDetailsSerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(lblSerID, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(lblRequired6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtSerID, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(pnlDetailsSerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(pnlDetailsSerLayout.createSequentialGroup()
                        .addComponent(lblSerName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(pnlDetailsSerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(lblCat, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(lblRequired4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(lblPrice, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(lblDesSer, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(pnlDetailsSerLayout.createSequentialGroup()
                        .addComponent(lblRequired3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(42, 42, 42)
                        .addGroup(pnlDetailsSerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(lblRequired5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(txtPrice, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jspDesSer, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(pnlDetailsSerLayout.createSequentialGroup()
                        .addComponent(txtSerName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(cboCat, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(lblSerMsg, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(33, 33, 33))
        );

        pnlButton.setOpaque(false);

        jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/Cancel.png"))); // NOI18N
        jButton1.setText("Cancel");
        pnlButton.add(jButton1);

        btnSave.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        btnSave.setForeground(new java.awt.Color(0, 51, 51));
        btnSave.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/Save.png"))); // NOI18N
        btnSave.setMnemonic('x');
        btnSave.setText("Save");
        btnSave.setToolTipText("Save to database");
        btnSave.setBorder(null);
        btnSave.setContentAreaFilled(false);
        btnSave.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        btnSave.setEnabled(false);
        btnSave.setMargin(new java.awt.Insets(6, 6, 6, 6));
        btnSave.setName(""); // NOI18N
        btnSave.setOpaque(true);
        btnSave.setPreferredSize(new java.awt.Dimension(59, 22));
        btnSave.setRolloverEnabled(false);
        pnlButton.add(btnSave);

        btnExit.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        btnExit.setForeground(new java.awt.Color(0, 51, 51));
        btnExit.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/quit.png"))); // NOI18N
        btnExit.setMnemonic('x');
        btnExit.setText("Exit");
        btnExit.setToolTipText("Close window");
        btnExit.setBorder(null);
        btnExit.setContentAreaFilled(false);
        btnExit.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        btnExit.setMargin(new java.awt.Insets(6, 6, 6, 6));
        btnExit.setName(""); // NOI18N
        btnExit.setOpaque(true);
        btnExit.setPreferredSize(new java.awt.Dimension(59, 22));
        btnExit.setRolloverEnabled(false);
        pnlButton.add(btnExit);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                            .addComponent(pnlManagement, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                                .addComponent(pnlDetailsCat, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(18, 18, 18)
                                .addComponent(pnlDetailsSer, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addGap(0, 0, Short.MAX_VALUE))
                    .addComponent(pnlButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(pnlManagement, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(pnlDetailsCat, javax.swing.GroupLayout.PREFERRED_SIZE, 279, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(pnlDetailsSer, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(pnlButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(3, 3, 3))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void mniViewAppActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mniViewAppActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_mniViewAppActionPerformed

    private void btnPopupActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnPopupActionPerformed
        JDesktopPane desk = getDesktopPane();
        JInternalFrame dlgRelApp = new FrmSerApp(dc,this,"","");
        desk.add(dlgRelApp);
        dlgRelApp.setVisible(true);
        
    }//GEN-LAST:event_btnPopupActionPerformed

    private void formComponentMoved(java.awt.event.ComponentEvent evt) {//GEN-FIRST:event_formComponentMoved
        JDesktopPane desk = getDesktopPane();
        JInternalFrame[] j = desk.getAllFrames();
        
        for (int i = 0; i < j.length; i++) {
            if ("SerApp".equals(j[i].getName()))
                j[i].setLocation(this.getX() + this.getWidth()+10, this.getY());
        }
            
    }//GEN-LAST:event_formComponentMoved
    
    private void tblSerValueChanged(javax.swing.event.ListSelectionEvent evt) {
        JOptionPane.showMessageDialog(this, "Handle for selection changed event");
    }
    
    private void tblSerMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tblSerMousePressed
        Point point = evt.getPoint();
        int currentRow = tblSer.rowAtPoint(point);
        tblSer.setRowSelectionInterval(currentRow, currentRow);
        //Disable menu if locked
    }//GEN-LAST:event_tblSerMousePressed

    private void formInternalFrameIconified(javax.swing.event.InternalFrameEvent evt) {//GEN-FIRST:event_formInternalFrameIconified
        JDesktopPane desk = getDesktopPane();
        JInternalFrame[] j = desk.getAllFrames();
        
        for (int i = 0; i < j.length; i++) {
            if ("SerApp".equals(j[i].getName()))
                j[i].setVisible(false);
        }
    }//GEN-LAST:event_formInternalFrameIconified

    private void formInternalFrameDeiconified(javax.swing.event.InternalFrameEvent evt) {//GEN-FIRST:event_formInternalFrameDeiconified
        JDesktopPane desk = getDesktopPane();
        JInternalFrame[] j = desk.getAllFrames();
        
        for (int i = 0; i < j.length; i++) {
            if ("SerApp".equals(j[i].getName()))
                j[i].setVisible(true);
        }
    }//GEN-LAST:event_formInternalFrameDeiconified

    private void formInternalFrameClosing(javax.swing.event.InternalFrameEvent evt) {//GEN-FIRST:event_formInternalFrameClosing
        JDesktopPane desk = getDesktopPane();
        JInternalFrame[] j = desk.getAllFrames();
        
        for (int i = 0; i < j.length; i++) {
            if ("SerApp".equals(j[i].getName()))
                j[i].dispose();
        }
    }//GEN-LAST:event_formInternalFrameClosing


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnAddCat;
    private javax.swing.JButton btnAddSer;
    private javax.swing.JButton btnDeselect;
    private javax.swing.JButton btnExit;
    private javax.swing.JButton btnLockCat;
    private javax.swing.JButton btnLockSer;
    private javax.swing.JButton btnPopup;
    private javax.swing.JButton btnSave;
    private javax.swing.JButton btnSelectAll;
    private javax.swing.JButton btnUnlockCat;
    private javax.swing.JButton btnUnlockSer;
    private javax.swing.JButton btnUpdateCat;
    private javax.swing.JButton btnUpdateSer;
    private javax.swing.JComboBox cboCat;
    private javax.swing.JButton jButton1;
    private javax.swing.JPopupMenu.Separator jSeparator1;
    private javax.swing.JPopupMenu.Separator jSeparator2;
    private javax.swing.JScrollPane jspCate;
    private javax.swing.JScrollPane jspDesCat;
    private javax.swing.JScrollPane jspDesSer;
    private javax.swing.JScrollPane jspSer;
    private javax.swing.JLabel lblCat;
    private javax.swing.JLabel lblCatID;
    private javax.swing.JLabel lblCatMsg;
    private javax.swing.JLabel lblCatName;
    private javax.swing.JLabel lblDesCat;
    private javax.swing.JLabel lblDesSer;
    private javax.swing.JLabel lblFac;
    private javax.swing.JLabel lblPrice;
    private javax.swing.JLabel lblRequired1;
    private javax.swing.JLabel lblRequired2;
    private javax.swing.JLabel lblRequired3;
    private javax.swing.JLabel lblRequired4;
    private javax.swing.JLabel lblRequired5;
    private javax.swing.JLabel lblRequired6;
    private javax.swing.JLabel lblRequired7;
    private javax.swing.JLabel lblSerID;
    private javax.swing.JLabel lblSerMsg;
    private javax.swing.JLabel lblSerName;
    private javax.swing.JList lstCat;
    private javax.swing.JMenuItem mniAddSer;
    private javax.swing.JMenuItem mniDeselect;
    private javax.swing.JMenuItem mniLockSer;
    private javax.swing.JMenuItem mniSelectAll;
    private javax.swing.JMenuItem mniUnlockSer;
    private javax.swing.JMenuItem mniUpdateSer;
    private javax.swing.JMenuItem mniViewApp;
    private javax.swing.JPopupMenu pmnSer;
    private javax.swing.JPanel pnlButton;
    private javax.swing.JPanel pnlCategory;
    private javax.swing.JPanel pnlDetailsCat;
    private javax.swing.JPanel pnlDetailsSer;
    private javax.swing.JPanel pnlManagement;
    private javax.swing.JPanel pnlService;
    private javax.swing.JTable tblSer;
    private javax.swing.JTextArea txaDesCat;
    private javax.swing.JTextArea txaDesSer;
    private javax.swing.JTextField txtCatID;
    private javax.swing.JTextField txtCatName;
    private javax.swing.JTextField txtFac;
    private javax.swing.JTextField txtPrice;
    private javax.swing.JTextField txtSerID;
    private javax.swing.JTextField txtSerName;
    // End of variables declaration//GEN-END:variables
}
